<template>
  <div class="Showcase1">
    <div class="Showcase1-top">
      <div
        class="light-box"
        v-for="(item, index) in props.list"
        :key="index"
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(Number(index)), item.width, 1.433)}rem`,
          top: `${ShowcaseItemTransform(item.y ? item.y : getParentX(Number(index)), item.height, 6.833)}rem`,
        }"
      >
        <img v-lazy="publicUrls + 'free/style9/displayBoardLight.webp'" alt="" class="ex-light" />
      </div>
      <div
        class="title-box"
        v-for="(item, index) in props.list"
        :key="index"
        :style="{ left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(Number(index)), item.width, 1.933)}rem` }"
      >
        <p>{{ item.name }}</p>
      </div>
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style9/showcase1TopLeft.webp'"
        alt=""
      />
      <div class="Showcase1-top-center">
        <img
          :src="publicUrls + 'free/style9/showcase1TopCenter-left.webp'"
          alt=""
          class="top-center-left"
        />
        <img
          :src="publicUrls + 'free/style9/showcase1TopCenter-center.webp'"
          alt=""
          class="top-center-center"
        />
        <img
          :src="publicUrls + 'free/style9/showcase1TopCenter-right.webp'"
          alt=""
          class="top-center-right"
        />
      </div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style9/showcase1TopRight.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <img
        class="Showcase1-center-left"
        :src="publicUrls + 'free/style9/showcase1CenterLeft.webp'"
        alt=""
      />
      <div class="Showcase1-center-center"></div>
      <img
        class="Showcase1-center-right"
        :src="publicUrls + 'free/style9/showcase1CenterRight.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-btm">
      <img
        class="Showcase1-btm-left"
        :src="publicUrls + 'free/style9/showcase1BtmLeft.webp'"
        alt=""
      />
      <div class="Showcase1-btm-center">
        <img
          class="btm-center-left"
          :src="publicUrls + 'free/style9/showcase1BtmCenter-left.webp'"
          alt=""
        />

        <img
          class="btm-center-center"
          :src="publicUrls + 'free/style9/showcase1BtmCenter-center.webp'"
          alt=""
        />

        <img
          class="btm-center-right"
          :src="publicUrls + 'free/style9/showcase1BtmCenter-right.webp'"
          alt=""
        />
      </div>
      <img
        class="Showcase1-btm-right"
        :src="publicUrls + 'free/style9/showcase1BtmRight.webp'"
        alt=""
      />
    </div>
    <!-- <div class="inverted">
      <img :src="publicUrls + 'free/style8/ShowcaseInverted1.webp'" alt="" class="left" />
      <div class="content"></div>
      <img :src="publicUrls + 'free/style8/ShowcaseInverted3.webp'" alt="" class="right" />
    </div> -->
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free9Style1',
});
</script>
<script lang="ts" setup>
import { publicUrls } from '@/utils/minxin';
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});

const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }
  return x + 0.1;
};
</script>

<style lang="less" scoped>
.Showcase1 {
  display: flex;
  flex-direction: column;
  // align-items: center;
  width: 100%;
  min-width: 352px;
  height: 100%;
  position: relative;
}
.light-box {
  position: absolute;
  // top: -320px;
  width: 210px;
  height: 440px;
  .ex-light {
    width: 100%;
    height: 100%;
  }
}
.title-box {
  width: 280px;
  height: 48px;
  background: url(https://static.jiyi.show/free/style9/showcaseTitleBg.webp) no-repeat;
  background-size: 100% 100%;
  // padding: 6px 20px;
  position: absolute;
  top: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  // overflow: hidden;
  p {
    width: 236px;
    color: #333;
    text-align: center;
    text-shadow: 0px 1px 1px rgba(133, 121, 104, 0.6);
    font-family: 'SourceHanSerifCN';
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: 180%; /* 32.4px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.Showcase1-top {
  display: flex;
  height: 174px;
  width: calc(100% - 45px);
}
.Showcase1-top-left {
  flex-shrink: 0;
  width: 102px;
  height: 100%;
}
.Showcase1-top-center {
  display: flex;
  width: 100%;
  min-width: 140px;
  height: 100%;
}
.top-center-left {
  width: 100%;
  min-width: 20px;
  height: 100%;
}
.top-center-center {
  width: 100%;
  min-width: 80px;
  height: 100%;
}
.top-center-right {
  width: 100%;
  min-width: 40px;
  height: 100%;
}
.Showcase1-top-right {
  flex-shrink: 0;
  width: 110px;
  height: 100%;
}
.Showcase1-center {
  display: flex;
  width: calc(100% - 45px);
  height: 100%;
  min-height: 70px;
}
.Showcase1-center-left {
  flex-shrink: 0;
  width: 102px;
  height: 100%;
}
.Showcase1-center-center {
  width: 100%;
  height: 100%;
  min-width: 140px;
}
.Showcase1-center-right {
  width: 110px;
  height: 100%;
  flex-shrink: 0;
}
.Showcase1-btm {
  width: calc(100% - 45px);
  display: flex;
  height: 70px;
}
.Showcase1-btm-left {
  width: 102px;
  height: 100%;
}
.Showcase1-btm-center {
  display: flex;
  width: 100%;
  min-width: 140px;
  height: 100%;
}
.btm-center-left {
  width: 100%;
  min-width: 20px;
  height: 100%;
}
.btm-center-center {
  width: 100%;
  min-width: 80px;
  height: 100%;
}
.btm-center-right {
  width: 100%;
  min-width: 40px;
  height: 100%;
}
.Showcase1-btm-right {
  width: 110px;
  height: 100%;
}
</style>
